(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
    ["pages/main/index"], {
        2048: function (e, t, i) {
            "use strict";
            i.d(t, "b", (function () {
                return n
            })), i.d(t, "c", (function () {
                return o
            })), i.d(t, "a", (function () {}));
            var n = function () {
                    var e = this.$createElement;
                    this._self._c
                },
                o = []
        },
        "2f17": function (e, t, i) {},
        "44d5": function (e, t, i) {
            "use strict";
            i.r(t);
            var n = i("d1e6"),
                o = i.n(n);
            for (var a in n)["default"].indexOf(a) < 0 && function (e) {
                i.d(t, e, (function () {
                    return n[e]
                }))
            }(a);
            t["default"] = o.a
        },
        "86f8": function (e, t, i) {
            "use strict";
            (function (e, t) {
                var n = i("4ea4");
                i("c150"), i("5c17"), i("a9ff");
                n(i("66fd"));
                var o = n(i("a752"));
                e.__webpack_require_UNI_MP_PLUGIN__ = i, t(o.default)
            }).call(this, i("bc2e")["default"], i("543d")["createPage"])
        },
        "8d94": function (e, t, i) {
            "use strict";
            var n = i("2f17"),
                o = i.n(n);
            o.a
        },
        a752: function (e, t, i) {
            "use strict";
            i.r(t);
            var n = i("2048"),
                o = i("44d5");
            for (var a in o)["default"].indexOf(a) < 0 && function (e) {
                i.d(t, e, (function () {
                    return o[e]
                }))
            }(a);
            i("8d94");
            var s = i("f0c5"),
                r = Object(s["a"])(o["default"], n["b"], n["c"], !1, null, null, null, !1, n["a"], void 0);
            t["default"] = r.exports
        },
        d1e6: function (e, t, i) {
            "use strict";
            (function (e, n, o) {
                var a = i("4ea4");
                Object.defineProperty(t, "__esModule", {
                    value: !0
                }), t.default = void 0;
                var s = a(i("2eee")),
                    r = a(i("c973")),
                    l = {
                        data: function () {
                            return {
                                salesman: [{
                                    groupTitle: "销售管理",
                                    items: [{
                                            itemUrl: "sales/create?names=".concat(e.names),
                                            itemTitle: "创建销售单",
                                            itemIcon: "/static/img/chuangjianxiaoshoudan.jpg"
                                        }, {
                                            itemUrl: "sales/my",
                                            itemTitle: "销售单查询",
                                            itemIcon: "/static/img/xiaoshoudanchaxun.jpg"
                                        },
                                        {
                                            itemUrl: "sales/connections",
                                            itemTitle: "客户管理",
                                            itemIcon: "/static/img/kehuguanli.jpg"
                                        }
                                    ]
                                }, {
                                    groupTitle: "采购管理",
                                    items: [{
                                            itemUrl: "purchaseOrder/buyfinishedgoodsAdd",
                                            itemTitle: "创建采购单",
                                            itemIcon: "/static/img/chuangjianxiaoshoudan.jpg",
                                        },
                                        {
                                            itemUrl: "purchaseOrder/buyfinishedgoodsList",
                                            itemTitle: "查询采购单",
                                            itemIcon: "/static/img/chaxuncaigoudan.jpg",
                                        }
                                    ]
                                }],
                                btnGroups: [],
                                btnGroup: [{
                                        groupTitle: "销售管理",
                                        items: [{
                                                itemUrl: "sales/create?names=".concat(e.names),
                                                itemTitle: "创建销售单",
                                                itemIcon: "/static/img/chuangjianxiaoshoudan.jpg"
                                            },
                                            //  { 
                                            //     itemUrl: "sales/audit",
                                            //     itemTitle: "销售审批",
                                            //     itemIcon: "icon-qianshou"
                                            // },
                                            {
                                                itemUrl: "sales/my",
                                                itemTitle: "销售单查询",
                                                itemIcon: "/static/img/xiaoshoudanchaxun.jpg"
                                            },
                                            {
                                                itemUrl: "sales/connections",
                                                itemTitle: "客户管理",
                                                itemIcon: "/static/img/kehuguanli.jpg"
                                            }

                                            // ,
                                            // {
                                            //     itemUrl: "commonh5/ch5?userinfo",
                                            //     itemTitle: "测试H5",
                                            //     itemIcon: "icon-tiaoboguanli",
                                            // }
                                        ]
                                    },
                                    {
                                        groupTitle: "采购管理",
                                        items: [{
                                                itemUrl: "purchaseOrder/buyfinishedgoodsAdd",
                                                itemTitle: "创建采购单",
                                                itemIcon: "/static/img/chuangjiancaigoudan.jpg",
                                            },
                                            {
                                                itemUrl: "purchaseOrder/buyfinishedgoodsList",
                                                itemTitle: "查询采购单",
                                                itemIcon: "/static/img/chaxundaigoudan.jpg",
                                            }
                                        ]
                                    },
                                    {
                                        groupTitle: "生产管理",
                                        items: [{
                                            itemUrl: "production/plan",
                                            itemTitle: "生产计划",
                                            itemIcon: "/static/img/shengchanjihua.jpg"
                                        }, {
                                            itemUrl: "production/search",
                                            itemTitle: "生产任务",
                                            itemIcon: "/static/img/shengchanrenwu.jpg"
                                        }, {
                                            itemUrl: "production/logs",
                                            itemTitle: "生产日志",
                                            itemIcon: "/static/img/shengchanrizhi.jpg"
                                        }]
                                    }, {
                                        groupTitle: "库房管理",
                                        items: [
                                            //     {
                                            //     itemUrl: "storehouse/scanIn",
                                            //     itemTitle: "扫码入库",
                                            //     itemIcon: "icon-saomiaoguanli"
                                            // },
                                            {
                                                itemUrl: "storehouse/scanlexq",
                                                itemTitle: "入库日志",
                                                itemIcon: "/static/img/rukurizhi.jpg"
                                            },
                                            {
                                                itemUrl: "storehouse/outxq",
                                                itemTitle: "出库日志",
                                                itemIcon: "/static/img/chukudan.jpg"
                                            }
                                            // , {
                                            //     itemUrl: "storehouse/unpacking",
                                            //     itemTitle: "扫码拆包",
                                            //     itemIcon: "icon-saomiaoguanli"
                                            // }
                                            ,
                                            {
                                                itemUrl: "storehouse/out",
                                                itemTitle: "出库单",
                                                itemIcon: "/static/img/chukudan.jpg"
                                            }
                                        ]
                                    }, {
                                        groupTitle: "司机端",
                                        items: [{
                                            itemUrl: "driver/my",
                                            itemTitle: "我的订单",
                                            itemIcon: "/static/img/wodedingdan.jpg"
                                        }]
                                    }
                                ],
                                btnGrouplingdao: [{
                                    groupTitle: "销售管理",
                                    items: [
                                        //     {
                                        //     itemUrl: "sales/audit",
                                        //     itemTitle: "销售审批",
                                        //     itemIcon: "icon-qianshou"
                                        // }, 
                                        {
                                            itemUrl: "sales/my",
                                            itemTitle: "销售单查询",
                                            itemIcon: "/static/img/xiaoshoudanchaxun.jpg"
                                        }
                                        // ,
                                        // {
                                        //     itemUrl: "sales/connections",
                                        //     itemTitle: "客户管理",
                                        //     itemIcon: "icon-tiaoboguanli"
                                        // }

                                    ]
                                }, {
                                    groupTitle: "生产管理",
                                    items: [{
                                        itemUrl: "production/plan",
                                        itemTitle: "生产计划",
                                        itemIcon: "/static/img/shengchanjihua.jpg"
                                    }, {
                                        itemUrl: "production/search",
                                        itemTitle: "生产任务",
                                        itemIcon: "/static/img/shengchanrenwu.jpg"
                                    }, {
                                        itemUrl: "production/logs",
                                        itemTitle: "生产日志",
                                        itemIcon: "/static/img/shengchanrizhi.jpg"
                                    }]
                                }],
                                model: {
                                    amount: 999,
                                    userName: "",
                                    phoneNumber: "",
                                    userRoles: "",
                                    names: ""
                                },
                                listData: [],
                                listRoles: []
                            }
                        },
                        methods: {
                            initData: function () {
                                var e = this;
                                console.log(e.btnGroups)
                                return (0, r.default)(s.default.mark((function t() {
                                    return s.default.wrap((function (t) {
                                        while (1) switch (t.prev = t.next) {
                                            case 0:
                                                e;
                                            case 1:
                                            case "end":
                                                return t.stop()
                                        }
                                    }), t)
                                })))()
                            },
                            outLogin: function () {
                                this.btnGroups = null;
                                getApp().globalData.userinfo = [], n.redirectTo({
                                    url: "/pages/login"
                                })
                            },
                            testMessage: function () {
                                n.getPushClientId({
                                    success: function (e) {
                                        console.log(e);
                                        var t = e.cid;
                                        console.log("客户端推送标识:", t), getApp().globalData.appPushInfo(t, "测试数据", "测试通知", "测试111", getApp().globalData.getId())
                                    },
                                    fail: function (e) {
                                        console.log(e)
                                    }
                                })
                            },
                            getPushPermission: function () {
                                return;
                                var e = n.getSystemInfoSync().platform;
                                if ("android" == e) {
                                    var t = plus.android.runtimeMainActivity(),
                                        i = t.getPackageName(),
                                        o = t.getApplicationInfo().plusGetAttribute("uid"),
                                        a = plus.android.importClass("androidx.core.app.NotificationManagerCompat"),
                                        s = a.from(t).areNotificationsEnabled();
                                    s || n.showModal({
                                        title: "提示",
                                        content: "请打开APP通知权限",
                                        success: function (e) {
                                            if (e.confirm) {
                                                var n = plus.android.importClass("android.content.Intent"),
                                                    a = plus.android.importClass("android.os.Build");
                                                if (a.VERSION.SDK_INT >= 26) {
                                                    var s = new n("android.settings.APP_NOTIFICATION_SETTINGS");
                                                    s.putExtra("android.provider.extra.APP_PACKAGE", i)
                                                } else if (a.VERSION.SDK_INT >= 21) {
                                                    s = new n("android.settings.APP_NOTIFICATION_SETTINGS");
                                                    s.putExtra("app_package", i), s.putExtra("app_uid", o)
                                                } else {
                                                    var r = plus.android.importClass("android.provider.Settings"),
                                                        l = plus.android.importClass("android.net.Uri");
                                                    s = new n;
                                                    s.setAction(r.ACTION_APPLICATION_DETAILS_SETTINGS);
                                                    var u = l.fromParts("package", t.getPackageName(), null);
                                                    s.setData(u)
                                                }
                                                t.startActivity(s)
                                            }
                                        }
                                    })
                                } else if ("ios" == e) {
                                    var r = permision.judgeIosPermission("push");
                                    r || n.showModal({
                                        title: "提示",
                                        content: "请打开APP通知权限",
                                        success: function (e) {
                                            e.confirm && gotoAppPermissionSetting()
                                        }
                                    })
                                }
                            }
                        },
                        onHide: function () {
                            clearInterval(this.timer), this.timer = null
                        },
                        onLoad: function (e) {


                            // fatitle: "销售管理" 
                            // icon: null
                            // id: 1
                            // name: "创建销售单"
                            // path: "http://localhost:8081/#/CreateSale"
                            // perms: "salessupervisor"
                            // roleId: "/appmenu/menu_role/listByRoleid"
                            // console.log(t.roles[0].roleKey)
                            // wx.request({
                            //     url: getApp().globalData.apiurl + 'appmenu/menu_role/listByRoleid',
                            //     method: "GET",
                            //     data: {
                            //         roleKey: t.roles[0].roleKey
                            //     },
                            //     success: res => {

                            //         let handmenus = []
                            //         let menus = {
                            //             groupTitle: null,
                            //             items: []
                            //         }
                            //         res.data.data.push({fatitle:'end'})
                            //         console.log(res.data.data)
                            //         res.data.data.forEach(item => {
                            //             if(item.fatitle=='end'){
                            //                 handmenus.push(menus)
                            //                 return;
                            //             }
                            //             if (menus.groupTitle == null) menus.groupTitle = item.fatitle;
                            //             if (menus.groupTitle != item.fatitle) {
                            //                 handmenus.push(menus);
                            //                 menus.groupTitle = item.fatitle;
                            //                 menus.items.push({
                            //                     itemUrl: 'commonh5/ch5?accessPath='+item.path,
                            //                     itemTitle: item.name,
                            //                     itemIcon: item.icon
                            //                 })
                            //             }else{
                            //                 // 添加子菜单
                            //                 menus.items.push({
                            //                     itemUrl: 'commonh5/ch5?accessPath='+item.path,
                            //                     itemTitle: item.name,
                            //                     itemIcon: item.icon
                            //                 })
                            //             } 

                            //         });
                            //         console.log(handmenus);
                            //         // 最终拼接菜单
                            //         this.btnGroups.push(handmenus[0]);
                            //     },
                            //     fail: res => {
                            //         console.log(res)
                            //     },
                            //     complete: res => {
                            //         console.log('请求完成')
                            //     }
                            // })


                            // // 最终循环展示的数组

                            // return;
                            // e.users, n.getStorageSync("key");
                            // var t = getApp().globalData.userinfo;

                            // console.log("测试角色：",t.roles[0].roleKey)

                            // if (void 0 != t.userName && "" != t.userName && 0 != t.length && 0 != t || n.redirectTo({
                            //         url: "/pages/login"
                            //     }), this.model.userName = t.userName, this.model.userRoles = t.nickName, "generalmanager" == t.roles[0].roleKey || "masterleader" == t.roles[0].roleKey)
                            //     for (var i = 0; i < this.btnGrouplingdao.length; i++) this.btnGroups.push(this.btnGrouplingdao[i]);
                            // "salessupervisor" != t.roles[0].roleKey && "salesman" != t.roles[0].roleKey && "admin" != t.roles[0].roleKey || ("salesman" == t.roles[0].roleKey ? (this.btnGroups.push(this.salesman[0]), console.log(this.salesman)) : this.btnGroups.push(this.btnGroup[0])), "StorageRoom" != t.roles[0].roleKey && "admin" != t.roles[0].roleKey || this.btnGroups.push(this.btnGroup[1]), "workshop" != t.roles[0].roleKey && "admin" != t.roles[0].roleKey || this.btnGroups.push(this.btnGroup[2]), "driver" != t.roles[0].roleKey && "admin" != t.roles[0].roleKey || this.btnGroups.push(this.btnGroup[3]), o.hideHomeButton(), this.initData(), this.getPushPermission()

                            // var username = options.users;

                            //将用户写入缓存
                            var key = n.getStorageSync('key');
                            var dataList = getApp().globalData.userinfo;
                            console.log(dataList);
                            if (dataList.userName == undefined || dataList.userName == '' || dataList.length == 0 || dataList == 0) {
                                n.redirectTo({
                                    url: '/pages/login'
                                })
                            }
                            this.model.userName = dataList.userName;
                            this.model.userRoles = dataList.nickName;
                            //查询用户角色
                            // 总经理 ｜｜ 懂事长
                            if (dataList.roles[0].roleKey == 'generalmanager' || dataList.roles[0].roleKey == 'masterleader') {
                                for (let i = 0; i < this.btnGrouplingdao.length; i++) {
                                    this.btnGroups.push(this.btnGrouplingdao[i]);
                                }
                            }
                            // 销售总监｜｜业务员 -- 通知历史记录
                            if (dataList.roles[0].roleKey == 'salessupervisor' ||
                                dataList.roles[0].roleKey == 'salesman' ||
                                dataList.roles[0].roleKey == 'admin'
                            ) {
                                if (dataList.roles[0].roleKey == 'salesman') {
                                    this.btnGroups.push(this.salesman[0]);
                                    console.log(this.salesman)
                                } else {
                                    this.btnGroups.push(this.btnGroup[0]);
                                }
                            }
                            // 采购
                            if (dataList.roles[0].roleKey == 'procure' ||
                                dataList.roles[0].roleKey == 'admin') {
                                console.log(this.btnGroup)
                                this.btnGroups.push(this.btnGroup[1]);
                            }
                            // 库房
                            if (dataList.roles[0].roleKey == 'StorageRoom' ||
                                dataList.roles[0].roleKey == 'admin') {
                                this.btnGroups.push(this.btnGroup[3]);
                            }
                            // 车间
                            if (dataList.roles[0].roleKey == 'workshop' ||
                                dataList.roles[0].roleKey == 'admin') {
                                this.btnGroups.push(this.btnGroup[2]);
                            }
                            // 司机
                            if (dataList.roles[0].roleKey == 'driver' ||
                                dataList.roles[0].roleKey == 'admin') {
                                this.btnGroups.push(this.btnGroup[4]);
                            }

                            // console.log(dataList.roles[0].roleKey)
                            // this.btnGroup[5]
                            // #ifdef MP-WEIXIN
                            wx.hideHomeButton();
                            // #endif
                            this.initData();
                            this.getPushPermission()
                        }
                    };
                t.default = l
            }).call(this, i("62e4")(e), i("543d")["default"], i("bc2e")["default"])
        }
    },
    [
        ["86f8", "common/runtime", "common/vendor"]
    ]
]);